<?php include 'login/Restrito.php';?>
  <?php
	require_once "banco/ConexaoBanco.php";
	
	$consultar = mysql_query("SELECT id_convenio, conv_nome, conv_tipo FROM convenio ORDER BY id_convenio DESC ");
	echo "<h3 align='center'>Lista de Convênio</h3>";
  	echo "<hr color='#0066FF' size='3px' >";
	echo "<p align='center' >Para excluir dados do convenio, clique no botão excluir: </p>";
	echo '<table border="2" align="center" id="tabela" >';
	
 	echo '<tr bgcolor="#0066FF" align="center" height="35px">';
	echo '<td>Código</td>';
	echo '<td>Convênio</td>';
	echo '<td>Descrição/Tipo</td>';
	echo '<td>Action</td>';
	//echo $consultarUsuarios;
	echo '</tr>';
	
	// popula as tabelas
	while($registro = mysql_fetch_assoc($consultar)){
	echo '<form method="post" action="convenio/ConvenioExluir.php">';
	echo '<tr>';
	echo "<td>".$registro['id_convenio']."</td>";
	echo '<td>'.$registro['conv_nome'].'</td>';
	echo '<td>'.$registro['conv_tipo'].'</td>';
	echo '<td align="center"><input type="hidden" name="id" value="'.$registro['id_convenio'].'"> 
		<input type="submit" value="Deletar" />
		</td>
	';
	echo '</tr></form>';
	
	}
	
	echo '</table>';
	
	mysql_close();
?>
  <br />
  <br />